View Issue Details

IDProjectCategoryView StatusLast Update
0001894K18X001.00 SKB SWANSWpublic2024-02-21 09:15
Reporter(ALTech) Sangmin Choi Assigned To(ALTech) Sangmin Choi Due Date
PrioritynormalSeveritys4-minorReproducibilityalways
Status closedResolutionfixed 
Summary0001894: STB doesn't enter the recovery mode every second try of "private_recovery"
DescriptionSTB don't enter the recovery mode every second try of "private_recovery"

The test steps are as follows.

1. STB enter the sleep mode.
2. Download firmware and call reboot function.
3. STB reboot and STB enter the recovery mode and upgrade the STB.
    And, STB go sleep after upgrade.
4. Download firmware and call reboot function again.
5. STB reboot but STB doesn't enter recovery mode.
    And, STB go sleep after upgrade.
TagsNo tags attached.
Attach Tags

Users monitoring this issue

User List (SW) Jacky Chiang , (SW) Jason Ling

Activities

(ALTech) Sangmin Choi

2024-02-16 14:51

developer   ~0015137

(ALTech) Sangmin Choi

2024-02-16 16:52

developer   ~0015138

Hello, Jason,

MW uses following command to upgrade firmware if the STB is sleep.

######################################################################################
public static final String REBOOT_REASON__PRIVATE_RECOVERY = "private_recovery";
 String rebootReason;

 rebootReason = REBOOT_REASON__PRIVATE_RECOVERY;
 PowerManager pm = (PowerManager)getApplicationContext().getSystemService(Context.POWER_SERVICE);
 pm.reboot(rebootReason);
######################################################################################

For the first upgrade, the sys.powerctl property is set as reboot,private_recovery.

For the second upgrade, the sys.powerctl property is set as reboot,private_recovery,quiescent.
Because the ro.boot.quiescent property is 1.
It is the Android framework flow, you can see in frameworks/base/services/core/java/com/android/server/power/PowerManagerService.java +3383.

And, when the sys.powerctl property is set as reboot,private_recovery,quiescent, the STB doesn't enter the recovery mode.

This issue reported from SKB QA, so please check this issue with priority.

In short, you can just check why the STB doesn't enter recovery mode when you set following property.
# setprop sys.powerctl reboot,private_recovery,quiescent

Thank you.
Sangmin Choi.

(ALTech) Sangmin Choi

2024-02-16 16:59

developer   ~0015139

Hello, Sam,

I didn't know Jason was assigned engineer for this issue.
Could you please check it?

Thank you.
Sangmin Choi.

(SW) Jerry Lin

2024-02-19 10:30

developer   ~0015146

Hi Sangmin ,
Please download SD test FW from ALT Server.
/release_by_fxn/swan_test_image/20240219_mantis1894

Jerry

(ALTech) Sangmin Choi

2024-02-19 13:35

developer   ~0015150

Hello, Jerry,

I checked the STB can enter the recovery mode using "setprop sys.powerctl reboot,private_recovery,quiescent".
Could you please explain me about modification?

Thank you.
Sangmin Choi.

(SW) Jerry Lin

2024-02-19 15:55

developer   ~0015152

Hi Sangmin,
I add some codes to check reboot mode.

====> project: syna-release/linux_4_9_q
diff --git a/kernel/reboot.c b/kernel/reboot.c
index 57beec5d..0e14d36b 100644
--- a/kernel/reboot.c
+++ b/kernel/reboot.c
@@ -217,7 +217,7 @@ void kernel_restart(char *cmd)
        if (strcmp(cmd, "system_reset") == 0) {
                strncpy(buffer,"reboot,quiescent",strlen("reboot,quiescent"));
                kernel_restart_prepare(buffer);
- } else if (strcmp(cmd, "private_recovery") == 0) {
+ } else if ((strcmp(cmd, "private_recovery") == 0) || (strcmp(cmd, "private_recovery,quiescent") == 0)) {
                strncpy(buffer,"recovery-update,quiescent",strlen("recovery-update,quiescent"));
                kernel_restart_prepare(buffer);
        } else
@@ -231,7 +231,7 @@ void kernel_restart(char *cmd)
        kmsg_dump(KMSG_DUMP_RESTART);
        if (strcmp(cmd, "system_reset") == 0)
                machine_restart(buffer);
- else if (strcmp(cmd, "private_recovery") == 0)
+ else if ((strcmp(cmd, "private_recovery") == 0) || (strcmp(cmd, "private_recovery,quiescent") == 0))
                machine_restart(buffer);
        else
                machine_restart(cmd);

====> project: system/core
diff --git a/init/reboot.cpp b/init/reboot.cpp
index 5b9096930..a7cbc827b 100644
--- a/init/reboot.cpp
+++ b/init/reboot.cpp
@@ -351,7 +351,14 @@ static void DoReboot(unsigned int cmd, const std::string& reason, const std::str
          reasons[1] == "hard" || reasons[1] == "warm")) {
         skip = strlen("reboot,");
     }
- property_set(LAST_REBOOT_REASON_PROPERTY, reason.c_str() + skip);
+
+ if (reasons.size() >= 2 && reasons[0] == "reboot" && reasons[1] == "private_recovery") {
+ LOG(INFO) << "Reboot reason: " << "private_recovery";
+ property_set(LAST_REBOOT_REASON_PROPERTY, "reboot,private_recovery");
+ } else {
+ property_set(LAST_REBOOT_REASON_PROPERTY, reason.c_str() + skip);
+ }
+
     sync();

Jerry

(ALTech) Sangmin Choi

2024-02-19 16:15

developer   ~0015153

Hello, Jerry,

I created the test branch "BFX-UA300_5.4.1_BPM-28648" at syna-release/linux_4_9_q and system/core.
Please push commits to BFX-UA300_5.4.1_BPM-28648 branches.
And, please add "[BPM-28648]" to prefix of commit messages.

Thank you.
Sangmin Choi.

(SW) Jerry Lin

2024-02-19 17:17

developer   ~0015154

Hi Sangmin,
done

Jerry

(ALTech) Sangmin Choi

2024-02-21 09:15

developer   ~0015166

Hello, Jerry,

This issue has gone after apply patch.
I will merge the test branch to main branch.

Thank you.
Sangmin Choi.

Issue History

Date Modified Username Field Change
2024-02-16 14:49 (ALTech) Sangmin Choi New Issue
2024-02-16 14:49 (ALTech) Sangmin Choi Status new => assigned
2024-02-16 14:49 (ALTech) Sangmin Choi Assigned To => (SW) Jason Ling
2024-02-16 14:51 (ALTech) Sangmin Choi Note Added: 0015137
2024-02-16 14:51 (ALTech) Sangmin Choi File Added: logcat_first_private_reboot.log
2024-02-16 14:51 (ALTech) Sangmin Choi File Added: logcat_second_private_reboot.log
2024-02-16 15:06 (ALTech) Sangmin Choi Assigned To (SW) Jason Ling => (ALTech) Sangmin Choi
2024-02-16 15:21 (SW) Jason Ling Issue Monitored: (SW) Jacky Chiang
2024-02-16 15:21 (SW) Jason Ling Issue Monitored: (SW) Jason Ling
2024-02-16 15:21 (SW) Jason Ling Assigned To (ALTech) Sangmin Choi => (SW) Sam Yang
2024-02-16 16:52 (ALTech) Sangmin Choi Note Added: 0015138
2024-02-16 16:53 (ALTech) Sangmin Choi Assigned To (SW) Sam Yang => (SW) Jason Ling
2024-02-16 16:58 (ALTech) Sangmin Choi Assigned To (SW) Jason Ling => (SW) Sam Yang
2024-02-16 16:59 (ALTech) Sangmin Choi Note Added: 0015139
2024-02-16 17:02 (SW) Jason Ling Assigned To (SW) Sam Yang => (SW) Jerry Lin
2024-02-19 10:30 (SW) Jerry Lin Note Added: 0015146
2024-02-19 13:35 (ALTech) Sangmin Choi Note Added: 0015150
2024-02-19 15:55 (SW) Jerry Lin Note Added: 0015152
2024-02-19 16:15 (ALTech) Sangmin Choi Note Added: 0015153
2024-02-19 17:17 (SW) Jerry Lin Note Added: 0015154
2024-02-21 09:14 (ALTech) Sangmin Choi Assigned To (SW) Jerry Lin => (ALTech) Sangmin Choi
2024-02-21 09:15 (ALTech) Sangmin Choi Status assigned => closed
2024-02-21 09:15 (ALTech) Sangmin Choi Resolution open => fixed
2024-02-21 09:15 (ALTech) Sangmin Choi Note Added: 0015166